import Vue from 'vue';
import App from './App.vue';
import router from './router';
import 'vant/lib/icon/local.css';
import '@/assets/scss/global.scss';
import '@/assets/scss/iconfont/iconfont.css';

import VueCountdown from '@chenfengyuan/vue-countdown';

import filters from '@/filter';

Vue.component(VueCountdown.name, VueCountdown);
Vue.use(filters);


import {
    Lazyload,
    Icon,
    Cell,
    CellGroup,
    loading,
    Button,
    Toast,
    NoticeBar,
    List,
    Dialog,
    Tab,
    Tabs,
    Row,
    Col,
    Grid,
    GridItem,
    Search,
    Skeleton,
    ImagePreview,
    Field,
    NavBar,
    Notify,
    Popup,
    Image,
    RadioGroup,
    Radio,
    Checkbox,
    CheckboxGroup,
    Sticky,
    IndexBar,
    IndexAnchor,
    Rate,
    Swipe,
    SwipeItem,
    SwipeCell
} from 'vant';

Vue.use(SwipeCell);
Vue.use(Rate);
Vue.use(SwipeItem);
Vue.use(Swipe);
Vue.use(IndexBar);
Vue.use(IndexAnchor);
Vue.use(Sticky);
Vue.use(Checkbox);
Vue.use(CheckboxGroup);
Vue.use(RadioGroup);
Vue.use(Radio);
Vue.use(Image);
Vue.use(Popup);
Vue.use(Notify);
Vue.use(NavBar);
Vue.use(ImagePreview);
Vue.use(Field);
Vue.use(Skeleton);
Vue.use(Search);
Vue.use(Grid).use(GridItem);
Vue.use(Row).use(Col);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(Dialog);
Vue.use(NoticeBar);
Vue.use(List);
Vue.use(Icon);
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(loading);
Vue.use(Button);
Vue.use(Toast);
Vue.use(Lazyload, {
    preLoad: 1.3,
    error: require('@/assets/images/goods_default.png'),
    loading: require('@/assets/images/loading.png'),
    attempt: 1,
    listenEvents: ['scroll'],
    lazyComponent: true
});


Vue.config.productionTip = false;

//focus
Vue.directive('focus', {
    inserted: function (el) {
        el.focus()
    }
})

new Vue({
    router,
    render: h => h(App)
}).$mount('#app');
